﻿//********************************************************************************//
//创建日期：<创建日期，2016-03-30>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：地下水打印账单
//********************************************************************************//
layui.use(["layer", "form", "element", "table", "jquery"],
    function() {
        var layer = layui.layer, form = layui.form, element = layui.element, table = layui.table, $ = layui.jquery;

        var table1 = table.render({
            elem: "#ContentList1",
            url: "",
            //width:1047,
            height: "full-130",
            page: false,
            id: "table1",
            cols: [
                [
                    { field: "S_YONGHUH", title: "用户号", sort: true, width: 90, align: "center" },
                    { field: "S_YONGHUM", title: "用户名", width: 400, align: "left" },
                    { field: "I_YM", title: "水量年月", width: 90, align: "center" }
                    // , { field: 'I_SYL', title: '实用量', width: 80, align: 'center' }
                    //, { field: 'I_SYJH', title: '实用计划', width: 90, align: 'center' }
                    , { field: "I_JJL", title: "加价量", width: 80, align: "center" },
                    { width: 90, fixed: "right", align: "center", toolbar: "#eBar1" }
                ]
            ]
        });
        load1();

        /*initial*/
        function initinfo() {

        }
        /*end initial*/

        /*event*/
        $("#oSearch").click(function() {
            load1();
        });
        //监听工具条
        table.on("tool(table1)",
            function(obj) {
                var data = obj.data;
                if (obj.event === "dj") {
                    var url = "/Pages/YongShui/13.LaihanGL/YUEDUTZDJ.aspx?yonghuh=" + data.S_YONGHUH;
                    layer.open({
                        type: 2,
                        title: "",
                        shadeClose: false,
                        shade: 0.8,
                        area: ["900px", "550px"],
                        content: url,
                        end: function() {
                            location = "YueDuTZKJDJ.html";
                        }

                    });

                }
            });


        /*event end*/

        /*list*/


        function load1() {
            table1.reload({
                url: "/ashx/LH/LaiHan.ashx",
                where: {
                    "op": "YUETIAOZDJXX",
                    "yhh": $("#cYHH").val()
                },
                done: function(res, curr, count) {
                    $("#lsCount").text(count);
                }
            });
        }
        /*end list*/

        /*logic*/

        /*logic end*/

    });